package com.caiyouxi.partner.service.impl;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.cache.RedisService;
import com.caiyouxi.common.service.BaseService;
import com.caiyouxi.partner.mapper.CpContractMapper;
import com.caiyouxi.partner.model.CpContractBean;
import com.caiyouxi.partner.service.CpContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CpContractServiceImpl extends BaseService implements CpContractService {
    @Autowired
    private CpContractMapper mapper;
    @Autowired
    private RedisService redisService;

    @Override
    public ResData delete_contract(CpContractBean bean) {
        return success(mapper.delete_cp_contract(bean.getCp_id()));
    }

    @Override
    public ResData insert_contract(CpContractBean bean) {
        return success(mapper.insert_cp_contract(bean));
    }

    @Override
    public ResData select_contract(CpContractBean bean) {
        return success(mapper.select_cp_contract(bean.getCp_id()));
    }

    @Override
    public ResData update_contract(CpContractBean bean) {
        return success(mapper.update_cp_contract(bean));
    }
}
